package org.liveboardgames.agricola.view.component
{
    import flash.events.MouseEvent;
    
    import org.liveboardgames.agricola.vo.card.Card;
    
    import mx.controls.Image;
    import mx.core.DragSource;
    import mx.managers.DragManager;
    
    public class CardImage extends Image
    {
        private var _card:Card;
        
        public function CardImage()
        {
            super();
            this.setStyle("horizontalCenter", "0");
            this.setStyle("verticalCenter", "0");
            this.height = 150;
            this.width = 97;
        }
        
        public function set card(value:Card):void
        {
            this._card = value;
            updateSource();
        }
        
        public function get card():Card
        {
            return this._card;
        }
        
        private function updateSource():void
        {
            if (_card != null)
            {
                this.source = _card.imagePath;
            }
        }
    }
}